Accounting software is structured as a set of tools (consisting of both C
programs and shell procedures) that can be used to build accounting
systems. _aaaa_cccc_cccc_tttt_ssss_hhhh(1M) describes the set of shell procedures built on top
of the C programs.
Connect-time accounting is handled by various programs that write records
into _////_vvvv_aaaa_rrrr_////_aaaa_dddd_mmmm_////_wwww_tttt_mmmm_pppp, as described in _uuuu_tttt_mmmm_pppp(4). The programs described in
_aaaa_cccc_cccc_tttt_cccc_oooo_nnnn(1M) convert this file into session and charging records, which
are then summarized by _aaaa_cccc_cccc_tttt_mmmm_eeee_rrrr_gggg(1M).
Process accounting is performed by the UNIX system kernel. Upon
termination of a process, one record per process is written to a file
(normally _////_vvvv_aaaa_rrrr_////_aaaa_dddd_mmmm_////_pppp_aaaa_cccc_cccc_tttt). The programs in _aaaa_cccc_cccc_tttt_pppp_rrrr_cccc(1M) summarize this
data for charging purposes; _aaaa_cccc_cccc_tttt_cccc_mmmm_ssss(1M) is used to summarize command
usage. Current process data can be examined using _aaaa_cccc_cccc_tttt_cccc_oooo_mmmm(1).
Process accounting and connect-time accounting (or any accounting records
in the _tttt_aaaa_cccc_cccc_tttt format described in _aaaa_cccc_cccc_tttt(4)) can be merged and summarized
into total accounting records by _aaaa_cccc_cccc_tttt_mmmm_eeee_rrrr_gggg (see _tttt_aaaa_cccc_cccc_tttt format in _aaaa_cccc_cccc_tttt(4)).
_pppp_rrrr_tttt_aaaa_cccc_cccc_tttt (see _aaaa_cccc_cccc_tttt_ssss_hhhh(1M)) is used to format any or all accounting records.
_aaaa_cccc_cccc_tttt_dddd_iiii_ssss_kkkk reads lines that contain user ID, login name, and number of disk
blocks and converts them to total accounting records that can be merged
with other accounting records.
By default, the _aaaa_cccc_cccc_tttt_dddd_iiii_ssss_kkkk command reads standard input and converts
records to _tttt_aaaa_cccc_cccc_tttt format, which it writes to standard output. (See
_aaaa_cccc_cccc_tttt(4) for the format.)
The _----_cccc option reads standard input and converts records to _cccc_aaaa_cccc_cccc_tttt format,
which it writes to standard output. These records can be merged with
other _cccc_aaaa_cccc_cccc_tttt records by using the _cccc_ssss_aaaa_aaaa_dddd_dddd_cccc(1M) command.
_aaaa_cccc_cccc_tttt_dddd_uuuu_ssss_gggg reads its standard input (usually from _ffff_iiii_nnnn_dddd _//// _----_pppp_rrrr_iiii_nnnn_tttt) and
computes disk resource consumption (including indirect blocks) by login.
If _----_uuuu is given, records consisting of those filenames for which _aaaa_cccc_cccc_tttt_dddd_uuuu_ssss_gggg
charges no one are placed in _f_i_l_e (a potential source for finding users
trying to avoid disk charges). If _----_pppp is given, _f_i_l_e is the name of the
password file. This option is not needed if the password file is
_////_eeee_tttt_cccc_////_pppp_aaaa_ssss_ssss_wwww_dddd. (See _dddd_iiii_ssss_kkkk_uuuu_ssss_gggg(1M) for more details.)
_aaaa_cccc_cccc_tttt_oooo_nnnn _[[[[_ffff_iiii_llll_eeee_]]]] changes the state and location of kernal accounting output.
If _f_i_l_e is given, _aaaa_cccc_cccc_tttt_oooo_nnnn directs the kernal to append the process
accounting records to _f_i_l_e, (_aaaa_cccc_cccc_tttt_oooo_nnnn will create the file if it doesn't
already exist). _aaaa_cccc_cccc_tttt_oooo_nnnn without _f_i_l_e turns accounting off. Although _aaaa_cccc_cccc_tttt_oooo_nnnn
may be run as root it is normally ran as _a_d_m. To change the state of
accounting _a_d_m requires the capability of CAP_ACCT_MGT and on Trusted
Irix systems CAP_MAC_WRITE. (see _cccc_aaaa_pppp_aaaa_bbbb_iiii_llll_iiii_tttt_iiii_eeee_ssss(4) ).
_aaaa_cccc_cccc_tttt_oooo_nnnn is typically ran by scripts and would not normally be run directly
by a user. If accounting is to be turned on and off manually, the script
_////_eeee_tttt_cccc_////_iiii_nnnn_iiii_tttt_...._dddd_////_aaaa_cccc_cccc_tttt _s_t_a_r_t|_s_t_o_p should be used. _////_eeee_tttt_cccc_////_iiii_nnnn_iiii_tttt_...._dddd_////_aaaa_cccc_cccc_tttt uses _ssss_uuuu(1M)
to acquire the necessary capabilities before calling
_////_uuuu_ssss_rrrr_////_llll_iiii_bbbb_////_aaaa_cccc_cccc_tttt_////_ssss_tttt_aaaa_rrrr_tttt_uuuu_pppp and _////_uuuu_ssss_rrrr_////_llll_iiii_bbbb_////_aaaa_cccc_cccc_tttt_////_ssss_hhhh_uuuu_tttt_dddd_oooo_wwww_nnnn which call _aaaa_cccc_cccc_tttt_oooo_nnnn.
_aaaa_cccc_cccc_tttt_wwww_tttt_mmmm_pppp writes a _uuuu_tttt_mmmm_pppp(4) record to its standard output. The record
contains the current time and a string of characters that describe the
_r_e_a_s_o_n. A record type of ACCOUNTING is assigned (see _uuuu_tttt_mmmm_pppp(4)). _r_e_a_s_o_n
must be a string of 11 or fewer characters, numbers, _$$$$, or spaces. The
accounting startup and shutdown scripts _////_uuuu_ssss_rrrr_////_llll_iiii_bbbb_////_aaaa_cccc_cccc_tttt_////_ssss_tttt_aaaa_rrrr_tttt_uuuu_pppp and
_////_uuuu_ssss_rrrr_////_llll_iiii_bbbb_////_aaaa_cccc_cccc_tttt_////_ssss_hhhh_uuuu_tttt_aaaa_cccc_cccc_tttt use the _aaaa_cccc_cccc_tttt_wwww_tttt_mmmm_pppp command to record system startup
and shutdown events.
For each user currently logged on, _cccc_llll_oooo_ssss_eeee_wwww_tttt_mmmm_pppp puts a false _DDDD_EEEE_AAAA_DDDD______PPPP_RRRR_OOOO_CCCC_EEEE_SSSS_SSSS
record in the _////_vvvv_aaaa_rrrr_////_aaaa_dddd_mmmm_////_wwww_tttt_mmmm_pppp file. _rrrr_uuuu_nnnn_aaaa_cccc_cccc_tttt (see _rrrr_uuuu_nnnn_aaaa_cccc_cccc_tttt(1M)) uses this
false _DDDD_EEEE_AAAA_DDDD______PPPP_RRRR_OOOO_CCCC_EEEE_SSSS_SSSS record so that the connect-time accounting procedures
can track the time used by users logged on before _rrrr_uuuu_nnnn_aaaa_cccc_cccc_tttt was invoked.
For each user currently logged on, _rrrr_uuuu_nnnn_aaaa_cccc_cccc_tttt uses _uuuu_tttt_mmmm_pppp_2222_wwww_tttt_mmmm_pppp to create an
entry in the file _////_vvvv_aaaa_rrrr_////_aaaa_dddd_mmmm_////_wwww_tttt_mmmm_pppp, created by _rrrr_uuuu_nnnn_aaaa_cccc_cccc_tttt. Entries in
_////_vvvv_aaaa_rrrr_////_aaaa_dddd_mmmm_////_wwww_tttt_mmmm_pppp enable subsequent invocations of _rrrr_uuuu_nnnn_aaaa_cccc_cccc_tttt to account for
connect times of users currently logged in.
EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT
The file _////_eeee_tttt_cccc_////_cccc_oooo_nnnn_ffff_iiii_gggg_////_aaaa_cccc_cccc_tttt controls the automatic startup and periodic
report generation of the accounting subsystem. If this file contains the
flag value _oooo_nnnn, process accounting is enabled by _////_eeee_tttt_cccc_////_iiii_nnnn_iiii_tttt_...._dddd_////_aaaa_cccc_cccc_tttt each
time the system is brought up, and nightly reports are generated and
placed in the directory _////_vvvv_aaaa_rrrr_////_aaaa_dddd_mmmm_////_aaaa_cccc_cccc_tttt_////_ssss_uuuu_mmmm. _cccc_hhhh_kkkk_cccc_oooo_nnnn_ffff_iiii_gggg(1M) should be used
to modify the contents of the _////_eeee_tttt_cccc_////_cccc_oooo_nnnn_ffff_iiii_gggg_////_aaaa_cccc_cccc_tttt file.
The accounting software consists of accounting report generation software
with built-in tables of fixed size that might need to be increased on
larger systems. All of these programs now check the environment when
they are invoked for the requested table sizes. The accepted environment
variables are
_A_C_C_T__M_A_X_U_S_E_R_S Indicates the number of different users that can be
reported by _dddd_iiii_ssss_kkkk_uuuu_ssss_gggg(1M) or _aaaa_cccc_cccc_tttt_dddd_uuuu_ssss_gggg(1M).